package com.swipemaster.game;

/** Since normal Thread can't be paused we have to emulate pausing. On pause we will create and start a new thread. */
public class ThreadManager
{
	private static GameThread gameThread = new GameThread();

	public static boolean isRunning()
	{
		return gameThread.isRunning();
	}

	public static void join() throws InterruptedException
	{
		gameThread.join();
	}

	public static void setRunning(boolean isRunning)
	{
		if (isRunning)
		{
			gameThread = new GameThread();
			gameThread.setRunning(true);
			gameThread.start();
		}
		else
		{
			gameThread.setRunning(false);
		}
	}
}
